// 找出距离1998年一月一日星期四来说，这一年一共有多少天既是星期五又是13号的日子
#include <iostream>
#include <cmath>
using namespace std;

bool is_leapyear(int year)
{
    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
    {
        return true;
    }
    else
        return false;
}

const int bad_day_in_nleapyear[12] = {12, 43, 71, 102, 132, 163, 193, 224, 255, 285, 316, 346};
const int bad_day_in_leapyear[12] = {12, 43, 72, 103, 133, 164, 194, 225, 256, 286, 317, 347};

int main()
{
    int year;
    cin >> year;
    int bad_days = 0;
    int interval_days = 0, day_in_week;
    for (int i = 1998; i < year; i++)
    {
        if (is_leapyear(i))
        {
            interval_days += 366;
        }
        else
        {
            interval_days += 365;
        }
    }
    day_in_week = (4 + interval_days - 1) % 7 + 1;
    // cout << day_in_week << endl; // 计算用户输入当年的一月一日是星期几
    if (is_leapyear(year))
    {
        for (int i = 0; i < 12; i++)
        {
            if ((day_in_week + bad_day_in_leapyear[i]) % 7 == 5)
            {
                bad_days++;
                if (i < 9)
                {
                    cout << year << "-"
                         << "0" << i + 1 << "-" << 13 << endl;
                }
                else
                {
                    cout << year << "-"
                         << i + 1 << "-" << 13 << endl;
                }
            }
        }
    }
    else
    {
        for (int i = 0; i < 12; i++)
        {
            if ((day_in_week + bad_day_in_nleapyear[i]) % 7 == 5)
            {
                bad_days++;
                if (i < 9)
                {
                    cout << year << "-"
                         << "0" << i + 1 << "-" << 13 << endl;
                }
                else
                {
                    cout << year << "-"
                         << i + 1 << "-" << 13 << endl;
                }
            }
        }
    }
    return 0;
}